package com.example.composedialogdemo.dialog

import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Info
import androidx.compose.material.icons.filled.Update
import androidx.compose.material.icons.filled.Upgrade
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.unit.dp

/**
 * @author: njb
 * @date:   2025/8/16 20:52
 * @desc:   描述
 */
@Composable
fun IconSimpleDialog(
    showDialog: Boolean,
    onDismiss:() -> Unit
){
    if (showDialog) {
        AlertDialog(
            onDismissRequest = onDismiss,
            shape = RoundedCornerShape(8.dp),
            icon = {
                Icon(Icons.Default.Info,
                contentDescription = "提示图标")
            },
            title = { Text("版本更新")},
            text = {Text("这个版本修改一些已知问题和用户体验！")},
            confirmButton = {
                TextButton(onClick = onDismiss) {
                    Text("立即更新")
                }
            }
        )
    }
}